let f7 = null;
let toast = null;

class Toast {
  static init(app) {
    f7 = app;
  }

  static show(param, animate = true) {
    Toast.dismiss();
    toast = f7.toast.create(param).open(animate)
  }

  static dismiss(animate = true) {
    let result = false;

    if (null != toast && toast.opened) {
      // toast.close(animate).destroy()
      toast.close(animate)
      toast = null;
      result = true
    }

    return result;
  }
}

export default Toast;
